/*1、题目：编写一个学校类，其中包含的成员变量为录取分数线和对该变量值进行设置和获取的方法。
编写一个学生类，包含成员变量有考生的姓名、考号、综合成绩、体育成绩。还有获取学生综合成绩和体育成绩的方法。
编写一个录取类，包含判断学生是否符合录取条件的方法。其中录取条件为：综合成绩在录取分数线之上，
或体育成绩在90以上并且综合成绩大于300。在该类的 main ()方法中，建立若干个学生对象，对符合录取条件的学生，
输出其信息及“被录取”。
 */
package demo;
//学校类
class School{
    private int entryScore;//录取线
    public School(){

    }
    public School(int entryScore){
        this.entryScore=entryScore;
    }
    public int getEntryScore() {
        return entryScore;
    }

    public void setEntry(int entryScore) {
        this.entryScore = entryScore;
    }
}
//学生类
class Student{
    public String name;//姓名
    public String examinationNumber;//考号
    private int overallGrade;//综合成绩
    private int athleticPerformance;//体育成绩

    public Student(String name, String examinationNumber, int overallGrade, int athleticPerformance) {
        this.name = name;
        this.examinationNumber = examinationNumber;
        this.overallGrade = overallGrade;
        this.athleticPerformance = athleticPerformance;
    }

    public int getOverallGrade() {
        return overallGrade;
    }

    public int getAthleticPerformance() {
        return athleticPerformance;
    }

    @Override
    public String toString() {
        return "student{" +
                "name='" + name + '\'' +
                ", examinationNumber='" + examinationNumber + '\'' +
                ", overallGrade=" + overallGrade +
                ", athleticPerformance=" + athleticPerformance +
                '}';
    }
}
//录取类
public class Enroll{

    public static void enroll(Student stu,School sch){
       if(stu.getOverallGrade()>sch.getEntryScore()||stu.getAthleticPerformance()>90&&stu.getOverallGrade()>300){
           System.out.println(stu.toString()+" 恭喜您！您被录取了");
       }else{
           System.out.println(stu.toString()+" 很遗憾，您未被录取！");
       }
    }
    public static void main(String[] args) {

        School school=new School();
        Enroll  enroll=new   Enroll();
        school.setEntry(80);

        Student student1=new Student("张一","1001",98,65);
        Student student2=new Student("张二","1002",90,65);
        Student student3=new Student("张三","1003",58,95);


        Enroll.enroll(student1, school);
        Enroll.enroll(student2, school);
        Enroll.enroll(student3, school);

    }
}

